//
//  InterfaceBase.h
//  OneCard
//
//  Created by sally on 16/2/17.
//  Copyright © 2016年 koalac. All rights reserved.
//

#import "ApiBase.h"
#import <Foundation/Foundation.h>

#define CREATE_REAL_URL(baseURL, path) [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", baseURL, path]]
#define Scheme @"http"

#define DicKeyResult @"result"
#define DicKeyErrorMsg @"error_msg"
#define DicKeyErrorCode @"error_code"
//列表类型接口用到
#define DicKeyList @"list"
//注册接口用到
#define DicKeyUser @"user"
#define DicKeyNewUser @"new_user"
//发验证码接口用到
#define DicKeySmsSent @"sms_sent"
#define DicKeyEmailSent @"email_sent"

//TODO: 测试用的uid，可删除
#define testNormalUId 880571392786434
#define testExpertUId 880552484864001
//phone=15900010002&password=1234
//phone=15900010001&password=1234

@class AFHTTPRequestOperation;

typedef void (^completion_t)(NSDictionary *resultObject, NSInteger code, NSString *description);
typedef void (^completion_t_user)(NSDictionary *resultObject, NSInteger code, NSString *description, BOOL isNewUser);
typedef void (^completion_t_code)(NSDictionary *resultObject, NSInteger code, NSString *description,BOOL isSuccess);
typedef void (^error_t)(NSError *error);
typedef void (^result)(NSData *data, NSString *name);

typedef void (^netCompletion_t)(AFHTTPRequestOperation *operation, id responseObject);
typedef void (^netFailure_t)(AFHTTPRequestOperation *operation, NSError *error);
typedef void (^httpClient_t)(NSString *resultStr);

@interface InterfaceBase : ApiBase

@property (nonatomic, strong) NSURL *interfaceURL;

- (id)initWithPath:(NSString *)path;

@end
